﻿<Window x:Class="DatabaseSelectorControlLibrary.Login"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Login" Height="180" Width="280">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <RadioButton Content="Use Windows Authentication" Margin="3"
                     x:Name="rbtWinAuth" IsChecked="True"/>
        <RadioButton Content="Use user authentication" Margin="3"
                     Grid.Row="1" x:Name="rbtUserAuth"/>
        <Grid x:Name="grdUser" Grid.Row="2" 
              IsEnabled="{Binding ElementName=rbtUserAuth, Path=IsChecked}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Label Content="Username:"/>
            <TextBox Grid.Column="1" Margin="5"
                     x:Name="tbxUsername"/>

            <Label Content="Password:" Grid.Row="1"/>
            <TextBox Grid.Row="1" Grid.Column="1" Margin="5"
                     x:Name="tbxPassword"/>
        </Grid>

        <Button Content="Cancel" HorizontalAlignment="Right" VerticalAlignment="Top"
                    Grid.Row="3" Margin="5" Grid.ColumnSpan="2"
                    Width="60" x:Name="btnCancel" IsCancel="True" />
        <Button Content="Login" HorizontalAlignment="Right" VerticalAlignment="Top"
                    Grid.Row="3" Margin="5,5,70,5" Grid.ColumnSpan="2"
                    Width="60" x:Name="btnLogin" IsDefault="True" Click="btnLogin_Click" />
    </Grid>
</Window>
